﻿Public Class MuhOdemeEmriHesapBakiye
	Inherits ProcessReport

	Dim eno As Input

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("Ödeme Emri Hesap Bakiyeleri", "Ödeme emri numarasını girin.")
				eno = AddOdemeEmri()
			Case EventType.ValidateForm
				Rs = Muhasebe.OdemeEmri.HesapBakiyeleri(Remote, eno.Get)
				If Check("eno", Rs.EOF, "Ödeme emri bulunamadı.") Then Return
				e.Result = True
			Case EventType.PageHeader
				Report.PrintReportInfo("ÖDEME EMRİ HESAP BAKİYELERİ", "ÖDEME EMRİ NO.: " & eno.Get)
				Report.SetColumns("Hesap no.;Hesap adı;Açıklama;Bakiye;Tutar;Son bakiye", "2;6;6;3;2;3", "c;l;l;m;m;m", "--")
			Case EventType.ReportDetail
				For Each Row In Rs
					If Not IsNull(Rs("bakiye")) Then
						Report.Print(Rs("hesapno"), Rs("hesapadi"), Rs("acik"), Rs("bakiye"), Rs("borc"), Rs("bakiye") - Rs("borc"))
					End If
				Next
		End Select
	End Sub

End Class
